package demo1;


class Animal {
    public String name;
    public Animal(String name) {
        this.name = name;
    }
}
interface IRun {
    void Running();
}
interface ISwim {
    void Swimming();
}
interface IFly {
    void Flying();
}
class Dog extends Animal implements IRun {
    public Dog(String name) {
        super(name);
    }
    public void Running() {
        System.out.println(this.name + "正在用四只腿 跑！！");
    }
}
class Duck extends Animal implements IRun,IFly,ISwim {
    public Duck(String name) {
        super(name);
    }
    public void Running() {
        System.out.println(this.name + "正在用两只腿 跑！！");
    }
    public void Flying() {
        System.out.println(this.name + "正在翅膀 飞！！");
    }
    public void Swimming() {
        System.out.println(this.name + "正在用翅膀 游！！");
    }

}
class Frog extends Animal implements IRun,ISwim {
    public Frog(String name) {
        super(name);
    }
    public void Running() {
        System.out.println(this.name + "正在用两只腿 跳！！");
    }
    public void Swimming() {
        System.out.println(this.name + "正在蛙泳！！");
    }
}
public class test1 {
    public static void main(String[] args) {
        Frog frog = new Frog("青蛙");
        Dog dog = new Dog("小狗");
        Duck duck = new Duck("小鸭子");
        dog.Running();
    }
}
